/**
 * 
 */
package org.swingannotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Use this to annotate a function in a controller
 * that is to be called when the specified event occurs
 * from a swing component.  The SwingAnnotations framework
 * will dynamically create a event listener and pass specified annotated
 * events to this callback function.  If the annotated function has a parameter
 * to recieve the awt.Event it will be passed, otherwise it will be disgarded.
 * 
 * An example is if you want a function to be called when a JButton emmits a 
 * MouseEvent when the mouse is clicked.  
 * <br>
 * <text>@JEventCallback(name="myButton",<br>
 * 			eventListener=java.awt.event.MouseListener.class,<br>
 * 			eventListenerFunction="mouseClicked")
 * 		void myCallbackFunction()
 * 		{.....
 * </text>
 * 
 * @author jduty
 *
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface JEventCallback {
	
	/**
	 * The name of the swing component to listen for events.
	 * @return
	 */
	String name();
	
	/**
	 * The event listener that you want the SwingAnnotations
	 * framework to dynamically create to listen for events.
	 * @return
	 */
	Class eventListener();

	/**
	 * The function within the dynamically created 
	 * event listener that you want to attach to this callback.  
	 * 
	 * 
	 * @return
	 */
	String eventListenerFunction();
	
	
}
